import {reqGetCategort} from '@/api'

const state = {
	categoryList: []   // 初始数据
};
const getters = {};
const mutations = {
	SET_CATEGORY_STATE(state, payload) {
		state.categoryList = payload.categoryList
	}
};
const actions = {
	async getCategoryList({commit}) {
		const result = await reqGetCategort()
		commit('SET_CATEGORY_STATE', {categoryList: result})
	}
};

export default {
	namespaced: true,
	state,
	getters,
	mutations,
	actions
}